#ifndef _STATEMENTIMPL_H_
#define _STATEMENTIMPL_H_

#include "stdafx.h"
#include <db/idatabase.h>

class CStatementImpl :	public IStatement, 
						public CUnknownImp
{ 

public:
	CStatementImpl(sqlite3* pSqlite3);
	virtual ~CStatementImpl(void);
public:
	BEGIN_STDCOM_MAP
		STDCOM_INTERFACE_ENTRY(IStatement)
	END_STDCOM_MAP

public:
	std_method(Query)(LPCSTR lpszSQL, UINT ulen, IRecordSet** pRecordSet);
	std_method_(int, Execute)(LPCSTR lpszSQL, UINT ulen);
	std_method_(int, Insert)(LPCSTR lpszSQL, UINT ulen);
	std_method(SetInt)(unsigned int nIndex, INT nValue);
	std_method(SetUInt)(unsigned int nIndex, UINT nValue);
	std_method(SetInt64)(unsigned int nIndex, int64 nValue);
	std_method(SetDouble)(unsigned int nIndex, double dbValue);
	std_method(SetFloat)(unsigned int nIndex, float fValue);
	std_method(SetBlob)(unsigned int nIndex, const unsigned char* lpszData, int nSize);
	std_method(SetString)(unsigned int nIndex, LPCSTR lpszData, int nSize);
	std_method(SetDateTime)(unsigned int nIndex, int64 nDateTime);
	std_method_(int, Commit)();
	std_method(Free)();
	std_method(Reset)();
	

public: 
	sqlite3*		m_pSqlite3;
	StmtPtr			m_pStmt;
	unsigned int	m_nParamCount;
};

#endif


